#include <iostream>

using namespace std;
const int maxn = 100005;
bool vis[maxn];
int only;

int main()
{
	int a;
	cin>>only;
	vis[only]=true;
    while (cin >> a) {
        if(vis[a])	continue;
        else{
        	vis[a]=true;
        	only=a;
        }
    }
    cout<<only<<endl;
    return 0;
}
